<?php
if (!empty($_POST['valid'])){

if(isset($_POST['products'])){ 
			if(isset($_POST['subsubcategory'])){
				
				foreach($_POST['products'] as $id){
						$famille_id=$_POST['subsubcategory'];
						$product=new Product($id);
						$product->load();
						$product['famille_id']=$famille_id;
						$product->save();
						}
			}
			            	
			if(isset($_POST['label'])){
				foreach($_POST['products'] as $id){
						$label_id=$_POST['label'];
						$product=new Product($id);
						$product->load();
						$product->addLabel($label_id);
						$product->save();	
				
			}

		}
	}
}


	
			?>